package com.hopu.mybatis01.service.impl;

import com.hopu.mybatis01.mapper.UserMapper;
import com.hopu.mybatis01.pojo.User;
import com.hopu.mybatis01.service.IUserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service //提供对象来调用方法
public class UserServiceImpl implements IUserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public List<User> select(String username, String password) {
        List<User> userList = userMapper.select(username, password);
        return userList;
    }

    @Override
    public void insert(String username, String password) {
        userMapper.insert(username,password);
    }

    @Override
    public void update(int id, String username, String password) {
        userMapper.update(id, username, password);
    }

    @Override
    public void delete(int id) {
        userMapper.delete(id);
    }




}
